<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title><?php echo $this->_tpl_vars['softtitle'] ?></title>
<link href="templates/css/baselist.css" rel="stylesheet" type="text/css" />
<link href="templates/css/all.css" rel="stylesheet" type="text/css" />
<link href="templates/css/formdiv.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/form.js"></script>
<script type="text/javascript" src="js/control.js"></script>
<link rel="stylesheet" type="text/css" href="js/jquery.multiselect.css" />
<link rel="stylesheet" type="text/css" href="js/style_1.css" />
<link rel="stylesheet" type="text/css" href="js/prettify.css" />
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/ui-lightness/jquery-ui.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
<script type="text/javascript" src="js/jquery.multiselect.js"></script>
<script type="text/javascript" src="js/prettify.js"></script>
<script type="text/javascript" src="js/test.js"></script>
<script type="text/javascript">

	var resizewindow= null;

	window.onresize = function(){
		var h = $(window).height();
		if(resizewindow!=h){
			sizewindow();
			resizewindow=h;
		}
	}

	function sizewindow(){
		var h = $(window).height();
		if(document.getElementById("mainbodybottonauto")){
			$('.managebottonadd').css({height:h-40});
		}
	}
	var memclassmanage_js_rankname_empty  = "<?php echo $this->_tpl_vars['ST']['reguralmemclassmanage_type_add_rankname_mess'] ?>";
	var memclassmanage_js_password_empty  = "<?php echo $this->_tpl_vars['ST']['reguralmemclassmanage_type_add_password_mess'] ?>";
	var memclassmanage_js_username_empty = "<?php echo $this->_tpl_vars['ST']['reguralmemclassmanage_type_add_username_mess'] ?>";
	var memclassmanage_js_tel_empty = "<?php echo $this->_tpl_vars['ST']['reguralmemclassmanage_type_add_tel_mess'] ?>";
	var memclassmanage_js_email_empty = "<?php echo $this->_tpl_vars['ST']['reguralmemclassmanage_type_add_email_mess'] ?>";
	var memclassmanage_js_integra_empty  = "<?php echo $this->_tpl_vars['ST']['memclassmanage_js_integra_empty'] ?>";
	var memclassmanage_js_type_add_ok = "<?php echo $this->_tpl_vars['ST']['reguralmemclassmanage_js_type_add_ok'] ?>";
	var memclassmanage_js_type_add_no = "<?php echo $this->_tpl_vars['ST']['reguralmemclassmanage_js_type_add_no'] ?>";
	var iframename = "<?php echo $this->_tpl_vars['iframename'] ?>";
	iframename = iframename=='' ? "jerichotabiframe_0" : iframename;
	$(document).ready(function(){
		var h = '<?php echo $this->_tpl_vars['iframeheightwindow'] ?>';
		$('.managebottonadd').css({height:h-40});
		var options = {
			beforeSubmit: formverify,
			success:saveResponse,
			resetForm: true
		}
		$('#classadd').submit(function() {
			$(this).ajaxSubmit(options);
			return false;
		});
	})




	function formverify(formData) {
		var queryString = $.param(formData);
		var get=urlarray(queryString);
		if(get['rankname']==''){
			document.classadd.rankname.focus();
			alert(memclassmanage_js_rankname_empty);
			return false;
		}
		if(get['password']=='') {
		   document.classadd.password.focus();
		   alert(memclassmanage_js_password_empty);
		   return false;
		}
		if(get['username'] == '') {
		   document.classadd.username.focus();
		   alert(memclassmanage_js_username_empty);
		   return false;
		}
		if(get['tel'] == '') {
			document.classadd.tel.focus();
			alert(memclassmanage_js_tel_empty);
			return false;
		}
		if(get['email'] == '') {
			document.classadd.email.focus();
			alert(memclassmanage_js_email_empty);
			return false;
		}
		parent.windowsdig('Loading','iframe:index.php?archive=management&action=load','400px','180px','iframe',false);
	}
	function saveResponse(options){
		parent.closeifram();
		var tab=document.getElementById("classaddtab").value;
		if (options=='true'){
			if (tab=='true'){
				if(parent.frames[iframename].document.getElementById("selectform")){
					parent.frames[iframename].refresh('selectform','selectall','check_all');
				}
			}
			alert(memclassmanage_js_type_add_ok);
		}else{
			alert(memclassmanage_js_type_add_no);
		}
		if (tab=='true'){
			parent.onaletdoc()
		}
	}
</script>
</head>

<body>
<form name="classadd" id="classadd" method="post" action="index.php?archive=memclassmanage&action=reguralclasssave">
<input type="hidden" name="inputclass" value="add">
<input type="hidden" name="tab" id="classaddtab" value="<?php echo $this->_tpl_vars['tab'] ?>">
<div id="mainbodybottonauto" class="managebottonadd">
	<div class="maindobycontent">
		<div class="suggestion">
			<span class="sugicon"><span class="strong colorgorning2"><?php echo $this->_tpl_vars['ST']['position_title'] ?></span><span class="colorgorningage"></span></span>
		</div>
		<div class="manageeditdiv">
			<div class="maneditcontent">
				<table class="formtable">
					<tr class="trstyle2">
						<td class="trtitle011"><?php echo $this->_tpl_vars['ST']['reguralmemclassmanage_type_add_rankname'] ?></td>
						<td class="trtitle02">
							<input type="text" name="rankname" size="30" maxlength="20" class="infoInput" onblur="checktypename('rankname',this.value,'index.php?archive=memclassmanage&action=checkmemberuser','usernameerr','<?php echo $this->_tpl_vars['ST']['membermain_js_input_ok'] ?>','<?php echo $this->_tpl_vars['ST']['membermain_js_input_no'] ?>','membersubmitbotton');">
							<span class="cautiontitle" id="usernameerr"><?php echo $this->_tpl_vars['ST']['reguralmemclassmanage_type_add_rankname_mess'] ?></span>
						</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01"><?php echo $this->_tpl_vars['ST']['reguralmemclassmanage_type_add_password'] ?></td>
						<td class="trtitle02">
							<input type="password" name="password" size="30" maxlength="20" class="infoInput"/>
							<span class="cautiontitle"><?php echo $this->_tpl_vars['ST']['reguralmemclassmanage_type_add_password_mess'] ?></span>
						</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01"><?php echo $this->_tpl_vars['ST']['reguralmemclassmanage_type_add_username'] ?></td>
						<td class="trtitle02">
							<input type="text" name="username" size="30" maxlength="20" class="infoInput"/>
							<span class="cautiontitle"><?php echo $this->_tpl_vars['ST']['reguralmemclassmanage_type_add_username_mess'] ?></span>
						</td>
					</tr>
					
					<tr class="trstyle2">
						<td class="trtitle01"><?php echo $this->_tpl_vars['ST']['reguralmemclassmanage_type_add_integra'] ?></td>
						<td class="trtitle02">
							<input readonly type="text" name="integra" size="30" maxlength="30" value="<?php echo $this->_tpl_vars['classread']['managergroup'] ?>" class="infoInput"/>
                                                        <hidden id="managergroup" value="<?php echo $this->_tpl_vars['classread']['managergroup'] ?>"/>
						</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01"><?php echo $this->_tpl_vars['ST']['reguralmemclassmanage_type_add_isinter'] ?></td>
						<td class="trtitle02">
							<select multiple="multiple" size="5">
                                                                <?php if (count($this->_tpl_vars['array'])>0){$divid_list=1;for($list=0;$list<count($this->_tpl_vars['array']); $list++){?>
                                                                        <option value="<?php echo $this->_tpl_vars['array'][$list]['group'] ?>"><?php echo $this->_tpl_vars['array'][$list]['group'] ?></option>
                                                                <?php }} ?>
							</select>
						</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01"><?php echo $this->_tpl_vars['ST']['reguralmemclassmanage_type_add_tel'] ?></td>
						<td class="trtitle02">
							<input type="text" name="tel" size="30" maxlength="20" class="infoInput"/>
							<span class="cautiontitle"><?php echo $this->_tpl_vars['ST']['reguralmemclassmanage_type_add_tel_mess'] ?></span>
						</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01"><?php echo $this->_tpl_vars['ST']['reguralmemclassmanage_type_add_email'] ?></td>
						<td class="trtitle02">
							<input type="text" name="email" size="30" maxlength="20" class="infoInput"/>
							<span class="cautiontitle"><?php echo $this->_tpl_vars['ST']['reguralmemclassmanage_type_add_email_mess'] ?></span>
						</td>
					</tr>
				</table>
			</div>
		</div>
	</div>
</div>
<div id="downbotton">
	<div id="subbotton">
		<table border="0" width="100%">
			<tr>
				<td id="right"><input type="submit" id="membersubmitbotton" name="Submit" value="<?php echo $this->_tpl_vars['ST']['botton_add'] ?>" class="buttonface" /></td>
				<td id="left" class="padding-left5"><input type="button" name="cancel" onClick="javascript:parent.onaletdoc();" value="<?php echo $this->_tpl_vars['ST']['botton_add_reset'] ?>" class="buttonface" /></td>
			</tr>
		</table>
	</div>
</div>
</form>
</body>

</html>